﻿using CatUtils.Utils.IoUtils;
using HostsTool.Currency;
using HostsTool.Utils;
using System;
using System.Windows.Forms;
using static HostsTool.Utils.HostEdit;

namespace HostsTool
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            InitView();
        }

        private void InitView()
        {
            new StartHelper().InitProgram();
            comboBox1.Items.AddRange(DnsStartivalue.InitDnsList().ToArray());
            comboBox1.SelectedIndex = 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            new FloderHelper().OpenFloder("http://www.acg12.net/?p=7325");
        }
      
        private void button2_Click(object sender, EventArgs e)
        {
         
            AutoAnalysisDelegate autoAnalysisDelegate = new HostEdit().AutoAnalysis;
            autoAnalysisDelegate.BeginInvoke(comboBox1.Text, textBox1.Text, true,null,null);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            new HostEdit().OpenNotPad();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            new HostEdit().DeleteModification();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            new HostEdit().SaveHostsAlert(comboBox1.Text, textBox1.Text);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            new StartHelper().OpenDnsFile(comboBox1);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            new FloderHelper().OpenFloder("http://www.acg12.net/?p=1324");
        }
    }
}